-
Notifications
You must be signed in to change notification settings - Fork 220
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add gallery example "Scale bar" #2822
Conversation
/format |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
Co-authored-by: Dongdong Tian <[email protected]>
Co-authored-by: Dongdong Tian <[email protected]>
# ----------------------------------------------------------------------------- | ||
# Add a thick scale bar | ||
# Adjust the GMT default parameter MAP_SCALE_HEIGHT locally (the change applies | ||
# only to the code within the "with" block) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# only to the code within the "with" block) | |
# only to the code within the "with" statement) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm. I am still not 100 % sure whether within the "with" statement
sounds better than within the "with" block
and makes sense. Maybe we can write under the "with" statement
if we want to use statement
instead of block
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel 'within the "with" statement' is better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK. Should I also update the formulations in the Figure.inset
line example:
Lines 119 to 131 in 06ae818
>>> # Use a "with" statement to initialize the inset context manager | |
>>> # Setting the position to top left and a width of 3.5 centimeters | |
>>> with fig.inset(position="jTL+w3.5c+o0.2c", margin=0, box="+pgreen"): | |
... # Map elements under the "with" statement are plotted in the inset | |
... fig.coast( | |
... region="g", | |
... projection="G47/-20/3.5c", | |
... land="gray", | |
... water="white", | |
... dcw="MG+gred", | |
... ) | |
... | |
>>> # Map elements outside the "with" block are plotted in the main figure |
Co-authored-by: Dongdong Tian <[email protected]>
Co-authored-by: Dongdong Tian <[email protected]>
Co-authored-by: Dongdong Tian <[email protected]>
Co-authored-by: Michael Grund <[email protected]>
Description of proposed changes
This PR aims to add a gallery example showing how to configurate a scale bar:
pygmt.Figure.basemap
)Upstream GMT documentation:
Preview: https://pygmt-dev--2822.org.readthedocs.build/en/2822/gallery/embellishments/scalebar.html
Fixes #2627
Reminders
make format
andmake check
to make sure the code follows the style guide.doc/api/index.rst
.Slash Commands
You can write slash commands (
/command
) in the first line of a comment to performspecific operations. Supported slash commands are:
/format
: automatically format and lint the code/test-gmt-dev
: run full tests on the latest GMT development version